<?php

namespace App\Http\Admin\Controllers\Scm;

use App\Http\Admin\Services\Scm\ScmService;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;


class ScmController extends Controller
{

    private $service;

    public function __construct(ScmService $scmService)
    {
        $this->service  =   $scmService;
    }

    /*
     * 入口
     * */
    public function index()
    {
        return view('scm.scm_list');
    }

    /*
     * 列表
     * */
    public function list(Request $request){

        $attrs  =   $request->all();

        $result =   $this->service->list($attrs);

        return res('ok',$result);

    }

    /*
   * 添加/编辑
   * */
    public function addScm(Request $request){

        $attrs  =   $request->all();

        $result =   $this->service->addScm($attrs);

        return res('ok',$result);

    }

    /*
   * 删除
   * */
    public function delete(Request $request){

        $attrs  =   $request->all();

        $result =   $this->service->delete($attrs);

        return res('ok',$result);

    }
}